﻿using System;
using System.Runtime.Serialization;
using MultiViewer.Network;
using System.Windows.Input;
using System.Windows;

namespace MultiViewer.Display
{
    [DataContract]
    public class InitDisplayRequest : Message
    {
        private int width, height;
        private bool fullscreen;

        public InitDisplayRequest(DisplayConfigurationElement config)
        {
            this.width = config.Width;
            this.height = config.Height;
            this.fullscreen = config.Fullscreen;
        }

        [DataMember]
        public int Width
        {
            get { return width; }
            set { width = value; }
        }

        [DataMember]
        public int Height
        {
            get { return height; }
            set { height = value; }
        }

        [DataMember]
        public bool Fullscreen
        {
            get { return fullscreen; }
            set { fullscreen = value; }
        }
    }

    [DataContract]
    public class ShutdownRequest
    {
        // No members here
    }

    [DataContract]
    public class MouseNotification : Message
    {
        private double x,y;

        [DataMember]
        public double X
        {
            get { return x; }
            set { x = value; }
        }

        [DataMember]
        public double Y
        {
            get { return y; }
            set { y = value; }
        }

        public Point Position
        {
            get { return new Point(x, y); }
            set
            {
                x = value.X;
                y = value.Y;
            }
        }
    }
}